package lib

func init() {
	Probs = append(Probs, Problem{
		Num:         70,
		Discription: "爬楼梯",
		Level:       1,
		Labels: map[string]int{
			"动态规划": 1,
		},
	})
}

func ClimbStairs(n int) int {
	if n == 1 {
		return 1
	}

	dp := make([]int, n)
	dp[0] = 1
	dp[1] = 2
	for i := 2; i < n; i++ {
		dp[i] = dp[i-1] + dp[i-2]
	}

	return dp[n-1]
}
